package com.kfpanda.file.monitor.bean;

public class FileNotify {
	private String name;
	private String rootPath;
	private String notify;
	private Long notifyTime;
	private String fileType;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getRootPath() {
		return rootPath;
	}
	public void setRootPath(String rootPath) {
		this.rootPath = rootPath;
	}
	public String getNotify() {
		return notify;
	}
	public void setNotify(String notify) {
		this.notify = notify;
	}
	public Long getNotifyTime() {
		return notifyTime;
	}
	public void setNotifyTime(Long notifyTime) {
		this.notifyTime = notifyTime;
	}
	public String getFileType() {
		return fileType;
	}
	public void setFileType(String fileType) {
		this.fileType = fileType;
	}
	
	public String collectName(){
		String collectName = "fileNotify";
		if(this.rootPath == null){
			return collectName;
		}
		int pos = this.rootPath.lastIndexOf("/");
		pos = pos >= 0 ? pos : this.rootPath.lastIndexOf("\\");
		if(pos < 0){
			return collectName;
		}
		String name = this.rootPath.substring(pos, this.rootPath.length());
		return collectName + "_" + name;
	}
}
